<template>
	<view>
		<u-popup v-model="showPopup" mode="center" width="400rpx" height="360rpx" closeable border-radius="14">
			<view class="authorize-tip">{{title}}</view>
			<view class="authorize-btn">
				<button open-type="openSetting" size="mini" @click="goSetting">去设置</button>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: '需要访问您的通讯地址，请到小程序的设置中打开通讯地址授权'
			},
		},
		data() {
			return {
				showPopup: false
			};
		},
		methods: {
			goSetting() {
				this.showPopup = false
			},
			open() {
				this.showPopup = true
			},
		}
	}
</script>

<style lang="scss">
	.authorize-tip {
		padding: 60rpx 70rpx 20rpx 70rpx;
	}

	.authorize-btn {
		display: flex;
		justify-content: center;
		align-items: center;

		button {
			background-color: #141414;
			color: #fff;
		}
	}
</style>
